<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="shortcut icon" href="/favicon.ico" />
<link href="__PUBLIC__/user/css/BasicStyle.css" rel="stylesheet"
	type="text/css">
<link href="__PUBLIC__/user/css/CommonStyle.css" rel="stylesheet"
	type="text/css">
<link href="__PUBLIC__/user/css/NavigationMasterPage.css"
	rel="stylesheet" type="text/css">
<link href="__PUBLIC__/user/css/AccountMasterPage.css" rel="Stylesheet"
	type="text/css">
<title>盈彩-合作伙伴-注册代理账号</title>
<script src="__PUBLIC__/user/js/jquery-1.9.1.min.js"
	type="text/javascript"></script>
<script language="javascript" type="text/javascript"
	src="__PUBLIC__/user/js/agent_register.js"></script>
<script language="javascript" type="text/javascript"
	src="__PUBLIC__/user/js/StringFormat.js"></script>
</head>
<body>
	<div>
		<block name="include"> <include file="User:agent_header" /></block>
		<div id="Main">
			<block name="include"> <include file="User:download_left" /></block>
			<form method="post" action="__CONTROLLER__/agent_register_post"
				onsubmit="return CheckFieldAgent()">

				<div id="Right">

					<div id="register_container">
						<div class="title">注册盈彩代理账号</div>
						<div class="Split10">&nbsp;</div>
						<div class="field">
							<span class="fieldlabel">用户名</span> <input name="username"
								type="text" id="agent_username"> <span
								class="fieldredstar">*</span> <span class="fielddescription">由3-20位英文,下划线,数字均可(用户名注册后不能修改)</span>
						</div>
						<br class="spacer">
						<div class="field">
							<span class="fieldlabel">密码</span> <input type="password"
								name="password" id="agent_password"> <span
								class="fieldredstar">*</span> <span class="fielddescription">由6-14位字符组成，请使用英文字母、符号或数字。</span>
						</div>
						<br class="spacer">
						<div class="field">
							<span class="fieldlabel">再次输入密码</span> <input type="password"
								name="password2" id="agent_password2"> <span
								class="fieldredstar">*</span> <span class="fielddescription">请再次输入密码。</span>
						</div>
						<br class="spacer">
						<div class="field">
							<span class="fieldlabel">QQ号码</span> <input name="qq"
								type="text" id="agent_qq"> <span class="fieldredstar">*</span>
							<span class="fielddescription"></span>
						</div>
						<br class="spacer">
						<div class="field">
							<span class="fieldlabel">手机号码</span> <input name="phone"
								type="text" id="phone"> <span class="fieldredstar">*</span>
							<button type="button" id="gain" style="float: left;">获取验证码</button>
							
						</div>
						<br class="spacer">
						<div class="field">
							<span class="fieldlabel">验证码</span> <input name="code"
								type="text" id="agent_code" style="width: 50px;"><span
								class="fieldredstar">*</span>
						</div>
						<br class="spacer">
						<div id="submitcontainer">
							<input class="buttonlink" type="submit"   value=" 确定 ">
						</div>
					</div>
				</div>
			</form>
		</div>
		<block name="include"> <include file="User:footer" /></block>
	</div>

	<script type="text/javascript">
	var countdown=60; 
		//发送验证码
			function settime(obj) { //发送验证码倒计时
			    if (countdown == 0) { 
			        obj.attr('disabled',false); 
			        //obj.removeattr("disabled"); 
			        obj.text("免费获取验证码");
			        countdown = 60; 
			        return;
			    } else { 
			        obj.attr('disabled',true);
			        obj.text("重新发送(" + countdown + ")");
			        countdown--; 
			    } 
			setTimeout(function() { 
			    settime(obj) }
			    ,1000) 
			}
		$('#gain')
				.click(
						function() {
							var phone = $('#phone').val();
							var agent_em_gs = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
							if (!agent_em_gs.test(phone)) {
								alert("手机格式不正确，请修改!");
							} else {
								$.ajax({
									url : "__APP__/Home/Sms/send_message",
									data : {
										'phone' : phone
									},
									dataType : "TEXT",
									type : "POST",
									success : function(data) {
										if (data == 2) {
											alert("手机号已被注册!");
										} else if(data == 3){
											alert("短信发送太频繁!");
										}else{
											 var obj = $("#gain");
											settime(obj);
										}
									}
								});
							}
						});
	</script>

</body>
</html>